# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.YouTube.V3.Model.Subscription do
  @moduledoc """
  A *subscription* resource contains information about a YouTube user subscription. A subscription notifies a user when new videos are added to a channel or when another user takes one of several actions on YouTube, such as uploading a video, rating a video, or commenting on a video.

  ## Attributes

  *   `contentDetails` (*type:* `GoogleApi.YouTube.V3.Model.SubscriptionContentDetails.t`, *default:* `nil`) - The contentDetails object contains basic statistics about the subscription.
  *   `etag` (*type:* `String.t`, *default:* `nil`) - Etag of this resource.
  *   `id` (*type:* `String.t`, *default:* `nil`) - The ID that YouTube uses to uniquely identify the subscription.
  *   `kind` (*type:* `String.t`, *default:* `youtube#subscription`) - Identifies what kind of resource this is. Value: the fixed string "youtube#subscription".
  *   `snippet` (*type:* `GoogleApi.YouTube.V3.Model.SubscriptionSnippet.t`, *default:* `nil`) - The snippet object contains basic details about the subscription, including its title and the channel that the user subscribed to.
  *   `subscriberSnippet` (*type:* `GoogleApi.YouTube.V3.Model.SubscriptionSubscriberSnippet.t`, *default:* `nil`) - The subscriberSnippet object contains basic details about the subscriber.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :contentDetails => GoogleApi.YouTube.V3.Model.SubscriptionContentDetails.t() | nil,
          :etag => String.t() | nil,
          :id => String.t() | nil,
          :kind => String.t() | nil,
          :snippet => GoogleApi.YouTube.V3.Model.SubscriptionSnippet.t() | nil,
          :subscriberSnippet => GoogleApi.YouTube.V3.Model.SubscriptionSubscriberSnippet.t() | nil
        }

  field(:contentDetails, as: GoogleApi.YouTube.V3.Model.SubscriptionContentDetails)
  field(:etag)
  field(:id)
  field(:kind)
  field(:snippet, as: GoogleApi.YouTube.V3.Model.SubscriptionSnippet)
  field(:subscriberSnippet, as: GoogleApi.YouTube.V3.Model.SubscriptionSubscriberSnippet)
end

defimpl Poison.Decoder, for: GoogleApi.YouTube.V3.Model.Subscription do
  def decode(value, options) do
    GoogleApi.YouTube.V3.Model.Subscription.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.YouTube.V3.Model.Subscription do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
